<template>
    <swiper :options="swiperOption">
        <swiper-slide v-for="(slide, index) in swiperSlides" :key="index">
            <img class="app-banner" :src="slide" alt="banner-pic">
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
</template>

<script>
import "swiper/dist/css/swiper.css";
import { swiper, swiperSlide } from "vue-awesome-swiper";

export default {
  name: "bannerComponent",
  components: {
    swiper,
    swiperSlide
  },
  props: {
    swiperSlides: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
      swiperOption: {
        loop: true,
        autoplay: 2000,
        autoplayDisableOnInteraction: false,
        pagination: ".swiper-pagination"
      }
    };
  }
};
</script>

<style scoped lang="less">
.app-banner {
  width: 100%;
  display: block;
  height: 540px;
}
.swiper-pagination-bullet {
  width: 20px !important;
  height: 20px !important;
}
</style>